{% extends "admin/base.html" %}
{% block content %}
<div class="wrap">
	{%ifequal entrytype "post"%}
	<h2>添加新文章</h2>
	{%else%}
	<h2>添加新页面</h2>
	{%endifequal%}
	{%if msg%}
	<div align="center" style="background-color: rgb(255, 251, 204);">
		<p>
		<strong>{{msg}}</strong> 
		</p>
	</div>
	{%endif%}
	<form action="/admin/submit_post" method="post">
		<input type="hidden" name="action" value="{{action}}"/>
		<input type="hidden" name="postid" value="{{entry.id}}"/>
		<input type="hidden" value="{{entry.published}}" name="published" />
		<input type="hidden" name="posttype" value="{{entrytype}}"/>
		<div id="poststuff" class="metabox-holder">
			<div id="side-info-column" class="inner-sidebar">
				<div id="side-sortables" class="meta-box-sortables ui-sortable" stype="position: relative;">
					{%ifequal entrytype "post"%}
					<div id="tagsdiv" class="postbox">
						<h3 class="hndle"><span>标签</span></h3>
						<input type="text" name="tags" id="tags" value="{{entry.tags}}"/>
						<p><b>多个标签请用英文逗号分开</b></p>
					</div>
					
					<div id="categorydiv" class="postbox">
						<h3 class="hndle"><span>目录</span></h3>
						<div id="allcategorys">
						{%if cats%}
							<select id='categories' name="category" multiple="multiple">
								{%for cat in cats%}
								<option value="{{cat.id}}" {%if cat.select %}selected="selected"{%endif%}>{{cat.name}}</option>
								{%endfor%}
							</select>
							{%else%}
							还没有分类目录,<a href="/admin/categories">添加</a>一个
							{%endif%}
						</div>
						<p><b></b></p>
					</div>
					{%else%}
					<div id="tagsdiv" class="postbox">
						<h3 class="hndle"><span>属性</span></h3>
						页面顺序<input type="text" name="order" id="order" value="{{entry.menu_order}}"/><br/>
						<p><b></b></p>
					</div>
					{%endifequal%}
					<div id="submitdiv" class="postbox">
						<h3 class="hndle"><span>发布</span></h3>
						<div id="submitpost">
							<div id="minor-publishing-actions">
							<span id="sticky-span" style="display: inline;">
							<input type="checkbox" tabindex="4" value="sticky" name="sticky" id="sticky" {%if entry.sticky%} checked{%endif%}> 
							<label class="selectit" for="sticky">置顶这篇文章到首页</label>
							<br>
							</span>
							<span style="display:inline;">
								<input type="checkbox" checked="checked" value="open" id="comment_status" name="allow_comment"> 
							<label class="selectit" for="sticky">这篇文章接受评论</label><br/>
							</span>
							<div id="save-action" class="alignleft">
							<input type="submit" class="button button-highlighted" tabindex="4" value="保存" id="save-post" name="save">
							</div>
							<div id="preview-action" >
								{%if entry.published%}
							  <input type="submit" value="取消发布" accesskey="p" tabindex="5" id="publish" class="button-primary alignright" name="unpublish">
							  {%else%}
							  <input type="submit" value="发布" accesskey="p" tabindex="5" id="publish" class="button-primary alignright" name="publish">
							  {%endif%}
							</div>
							<div class="clear"></div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="post-body" class="has-sidebar">
				<div id="post-body-content" class="has-sidebar-content">
					<div id="titlediv">
						<div id="titlewrap">
							<input type="text" autocomplete="off" id="title" tabindex="1" size="30" name="title" value="{{entry.title}}"/>
						</div>
					</div>
					<div id="postdivrich" class="postarea">
						<textarea rows="18" cols="40" name="content" tabindex="2" id="content">{{entry.content}}</textarea>
					</div>
					<div id="normal-sortables" class="meta-box-sortables ui-sortable" stype="position: relative;">
						<div id="postslug" class="postbox">
							<h3 class="hndle">Slug</h3>
							<div id="titlewrap">
								<input type="text" autocomplete="off" id="slug" tabindex="1" size="30" name="slug" value="{{entry.slug}}"/>
							</div>
							<p><b><b>Slug可以提高 URLs 的可读性和对搜索引擎的友好程度</b></b></p>
							
						</div>
						<div id="postexcerpt" class="postbox">
							<h3 class="hndle">摘要</h3>
							<textarea id="excerpt" tabindex="6" name="excerpt" cols="40" rows="2">{{entry.excerpt}}</textarea>
							<p><b><b>摘要是您手动添加的内容概要。</b></b></p>
						</div>
					</div>
				</div>
			</div>
			<b><b><br class="clear"></br></b></b>
		</div>
	</form>
</div>
<script type="text/javascript" src="/tinymce/tiny_mce.js"></script>
<script type="text/javascript" src="/static/admin/utils.js"></script>
<script type="text/javascript" src="/static/admin/tinymceinit.js"></script>

{%endblock%}
